package com.iwhalecloud.bss.kite.cucc.service.menu;

import com.iwhalecloud.bss.kite.cucc.client.api.menu.ICuccMenuService;
import com.iwhalecloud.bss.kite.cucc.dataservice.cache.KiteMenuCache;
import com.iwhalecloud.bss.kite.cucc.dataservice.entity.KiteMenu;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class CuccMenuService implements ICuccMenuService {

    @Override
    public String getMenuPath(String menuId) {
        KiteMenu menu = KiteMenuCache.getMenu(menuId);
        return Optional.ofNullable(menu).map(KiteMenu::getMenuPath).orElse("");
    }
}
